from video_list import *
from xigua_downloader import *

if __name__ == "__main__":
    user_id = '2317401847250772'
    mama = video()
    video_id, video_dict = mama.run(user_id)
    downloader = xigua_downloader()
    
    file_list = os.listdir('./video')
    
    for i in video_id:
        #处理标题
        intab = "?*/\|.:><"
        outtab = "         "
        trantab = str.maketrans(intab, outtab)
        video_dict[i] = video_dict[i].translate(trantab)
        
        if video_dict[i] + '.mp4' in file_list:
            print(video_dict[i] +'.mp4 该文件已存在')
            continue
        else:
            downloader.run(i)
        
